<?php 
namespace juven\libs {
    \defined( '_JEXEC' ) or die( 'Restricted access' );
    
    class DynamicContainer {
        protected $_container = array();

        public function __construct(array $array=array()){ $this->_container = $array; }
        public function __get($name){
            if(\array_key_exists($name,$this->_container)){
                return $this->_container[$name];
            } else { return \NULL; }
        }
        public function __set($name,$value){ $this->_container[$name] = $value; }
        public function __isset($name){ return isset($this->_container[$name]); }
        public function __unset($name){ unset($this->_container[$name]);        }
        public function toArray(){ return (array)$this->_container; }
        public function clear(){ $this->_container = array(); }
        public function __destruct() { }
    }
}
?>